package com.google.appengine.api.datastore;

import com.google.appengine.api.NamespaceManager;

/**
 *
 * @author Secondary User
 */
public class KeyFactory
{

	public static Key createKey(Key parent, String kind, long id)
	{
		return new Key(NamespaceManager.get(), parent, kind, null, id);
	}

	public static Key createKey(String kind, long id)
	{
		return new Key(NamespaceManager.get(), null, kind, null, id);
	}

	public static Key createKey(Key parent, String kind, String name)
	{
		return new Key(NamespaceManager.get(), parent, kind, name, Key.NO_ID);
	}

	public static Key createKey(String kind, String name)
	{
		return new Key(NamespaceManager.get(), null, kind, name, Key.NO_ID);
	}
	
	public static Key stringToKey(String string)
	{
		return Key.fromKeyString(string);
	}

	public static String keyToString(Key raw)
	{
		return raw.toKeyString();
	}
}
